#!/bin/sh

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
TERM=linux
PS2='>'

/bin/echo "Mount root system ......"
#install /proc
/bin/mount -n -t proc none /proc 
#reinstall root file system by read/write mode and need /etc/fstab
/bin/mount -a 
/bin/mount -n -o remount,rw / 
#reinstall /proc
/bin/mount -n -o remount,rw -t proc none /proc 

/bin/echo "Check file system ......"
/sbin/fsck -T -R -A -a 

VERSION=Recover
PS1="Mini $VERSION> "
export PATH TERM PS1 PS2 VERSION

/bin/echo "Mkdir the usr dir ......" 
/bin/mkdir -p /usr/lib 1>/dev/null 2>&1
/bin/mkdir -p /usr/tmp 1>/dev/null 2>&1
/bin/mkdir -p /usr/lock 1>/dev/null 2>&1
/bin/mkdir -p /usr/run 1>/dev/null 2>&1
/bin/mkdir -p /usr/spool 1>/dev/null 2>&1

/bin/sync 1>/dev/null 2>&1

cd /

/sbin/ldconfig -v >/dev/null 2>&1

/sbin/mount LABEL=CONTENT /ldisk 1>/dev/null 2>&1
/sbin/mount LABEL=EXTEND  /mnt 1>/dev/null 2>&1

/bin/hostname Mini 1>/dev/null 2>&1

/sbin/telnetd 1>/dev/null 2>&1

/sbin/ifconfig eth2 192.168.1.200 1>/dev/null 2>&1
/sbin/ifconfig eth2 up 1>/dev/null 2>&1

/bin/chmod +x /recover.sh 1>/dev/null 2>&1
/recover.sh &

